import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        navs: [], // 导航分类
        navSelected: 0, // 选中的导航
        navCategory: 0, // 选中的导航分类
        indexOrder: 'new', // 首页筛选排序
        user: {
            /*id: 1,
            name: '张三',
            email: '88888888@qq.com',
            http_head_img: 'http://local.larabbs.com/storage/public/default.jpg',
            api_token: 'd73deaaa17274039bf3f0c26501f90f6'*/
        }
    },
    mutations: {
        saveNavSelected (state, value) {
            state.navSelected = value
        },
        saveNavCategory (state, value) {
            state.navCategory = value
        },
        saveIndexOrder (state, value) {
            state.indexOrder = value
        },
        saveUser (state, value) {
            state.user = value
        }
    }
})